<%--
  -	$Version: 0.1 $
  -	$Date: 2008-09-09 16:48:22 $
--%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>


<%@page import="org.jawa.Constants,org.jawa.util.ParamUtils"%>
<%@ page import="java.util.HashMap"%>
<%@ page import="java.util.Locale"%>
<%@ page import="java.util.Map"%>
<%@ page import="java.util.StringTokenizer"%>

<%  // Get parameters
	String localeCode = ParamUtils.getParameter(request,"localeCode");
	boolean save = request.getParameter("save") != null;
	
	Map errors = new HashMap();
	
	if (save) {
	    Locale newLocale = null;
	    if (localeCode != null) {
	        newLocale = Constants.localeCodeToLocale(localeCode.trim());
	        if (newLocale == null) {
	            errors.put("localeCode","");
	        }
	        else {
	            Constants.setLocale(newLocale);
	            // redirect
	            response.sendRedirect("setup-datasource-settings.jsp");
	            return;
	        }
	    }
	}
	Locale locale = Constants.getLocale();
%>

<html>
<head>
<title><fmt:message key="setup.language.setting.title" /></title>
<meta name="currentStep" content="2" />
</head>
<body>
<h1><fmt:message key="setup.language.setting.title" /></h1>
<p><fmt:message key="setup.language.settings.info" /></p>

<!-- BEGIN jawa-contentBox -->
<div class="jawa-contentBox">
	<h2><fmt:message key="setup.language.title" /></h2>
	<form action="setup-language-settings.jsp" name="sform">
		<%
			boolean usingPreset = false;
		%>
		<div id="jawa-setup-language">
			<p>
				<label for="loc03">
					<input type="radio" name="localeCode" value="en" <%=("en".equals(locale.toString().trim()) ? "checked" : "")%> id="loc03" /> 
					<b>English</b> (en)
				</label>
				<br>
			
				<label for="loc10"> 
					<input type="radio" name="localeCode" value="zh_CN" <%=("zh_CN".equals(locale.toString()) ? "checked": "")%> id="loc10" />
					<img src="${ctx}/images/jawa-setup-language-zh_CN.gif" border="0" align="top" />
					<b>Simplified Chinese</b> (zh_CN)
				</label>
				<br>
			</p>
		</div>
		
		<div align="right"><input type="submit" name="save"
			value="<fmt:message key="button.continue" />" id="jawa-setup-save"
			border="0">
		</div>
	</form>
</div>
<!-- END jawa-contentBox -->
</body>
</html>
